package csc.fresher.service;

import java.util.List;

import csc.fresher.entity.AccountHasInterestRate;
import csc.fresher.entity.Customer;
import csc.fresher.entity.CustomerAccount;
import csc.fresher.entity.CustomerAccountOverall;
import csc.fresher.entity.SavingAccount;

public interface SavingAccountService {
	
	/**
	 * {@inheritDoc}
	 * 
	 * Get customer account (saving account) by accountNumber
	 * 
	 * @param accNumber
	 * @return
	 */
	public CustomerAccount getCustomerAccountByAccNumber(long accountNumberID);
	public List<CustomerAccount> getListCustomerAccountByIDCardNumber(long idCardNumber);
	public CustomerAccount getCustomerAccountByID(long accountNumberID);
	public double getCurrentAccountBalance(CustomerAccount customerAccount);
	/**
	 * {@inheritDoc}
	 * Check interest rate expired date when user transaction is state 'hold'
	 * If interest rate has expired, function'll update user balance and state
	 * 
	 * @param accountNumberID
	 * @return true if expired date
	 */
	public boolean checkInterestRateExpiredDate(CustomerAccount customerAccount);
	/**
	 * {@inheritDoc}
	 * Calculate profit when user want to cancel saving duration
	 * 
	 * @param customerAccount
	 * @return
	 */
	public boolean calculateProfitBeforeExpiredDate(CustomerAccount customerAccount);
	
	public Customer getCustomerByCustomerID(long customerID);
	public List<CustomerAccount> getAllSavingAccounts();

	
	public List<CustomerAccountOverall> getAccountByIDCardNumber(
			long idCardNumber, String accountType);

	public List<CustomerAccountOverall> getAccountByFirstName(String firstName,
			String accountType);
	public List<CustomerAccountOverall> getAccountByAccountNumber(long accountNumber, String accountType);
	public List<CustomerAccountOverall> getAccountByEmail(String email, String accountType);

	public List<CustomerAccount> getSavingAccountsIsRepeatable();
	
	public boolean updateSavingAccount(SavingAccount savingAccount);
	public boolean updatePeriod(SavingAccount savingAccount);
}
